package org.smart4j.framework.common.aop.proxy.statics;

import org.smart4j.framework.common.bean.Hello;

/**
 * 静态代理类
 * 缺点：代码中将会有N多的XXXProxy类
 *
 * @author YooLin1c
 * @version 1.0.0
 * @since 2018-02-01 12:13
 */
public class HelloProxy implements Hello {
    private Hello target;

    public HelloProxy(Hello target) {
        this.target = target;
    }

    @Override
    public void say() {
        this.before();
        this.target.say();
        this.after();
    }

    private void after() {
        System.out.println("after");
    }

    private void before() {
        System.out.println("before");
    }
}
